import request from "@/utils/request"

export const getCategoryAPI = (id) => {
  return request.get("/category", {
    params: {
      id
    }
  })
}

/**
 * 获取分类筛选数据
 * @param {*} id 分类id
 * @returns
 */
export const getCategoryFilterAPI = (id) => {
  return request.get("/category/sub/filter", {
    params: {
      id
    }
  })
}

/**
 * 获取分类下的商品数据
 * @data{
 *  categoryId:xxxxx
 *  page:1
 *  pageSize:20
 *  sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
 * }
 * @returns
 */
export const getSubCategoryGoodsAPI = (data) => {
  // return request.post("/category/goods/temporary", data)
  return request.post("/category/goods", data)
}

